<{if !$_is_singlepage}>

<form method="POST" action="index.php?app=b2c&ctl=admin_goodscollection&act=close" class="tableform" id="form_member_lv">
<div class="division">

	<table cellpadding="0" cellspacing="0"  class="gridlist">
		<col style="width:20%"></col>
		<col style="width:35%"></col>
		<col style="width:20%"></col>
		<!--<col style="width:10%"></col>-->
		<col style="width:25%"></col>

		<thead>
		<tr>
			<th><{t}>货号<{/t}></th>
			<th><{t}>商品名称<{/t}></th>
			<th><{t}>计划数量<{/t}></th>
			<!--<th><{t}>购买数量<{/t}></th>-->
			<th><{t}>集货数量<{/t}></th>
		</tr>
		</thead>
		<tbody>
		<{foreach from=$info item=item key=key}>
		<tr>
			<td><{$item.bn}></td>
			<td><{$item.name}></td>
			<td><{$item.has_confirm_num}></td>
			<!--<td><{$item.quantity}></td>-->
			<td>
				<{$item.gc_confirm_num}>
				<input type="hidden" name="data[<{$key}>][obj_id]" value="<{$item.obj_id}>"/>
				<input type="hidden" name="data[<{$key}>][bn]" value="<{$item.bn}>"/>
				<input type="hidden" name="mainOrder_id" value="<{$item.mainOrder_id}>"/>
			</td>
		</tr>
		<{/foreach}>
		<tr>
			<td colspan="5"></td>
		</tr>
		<tr>
			<td><{t}>备注:<{/t}></td>
			<td colspan="4">
				<{input type="textarea" class="inputstyle" name="memo" value=$item.memo style="width:98%" rows=7 readonly="readonly"}>
				<input type="hidden" name="gc_id" value="<{$gc_id}>" />
			</td>
		</tr>
		</tbody>
	</table>

</div>
</form>
<{area inject='.mainFoot'}>
     <div class="table-action">
	<{button type="button" label=$___b2c="确认"|t:'b2c' id="member_lv-form-submit"}>
</div>
<{/area}>





<script>
(function(){
	var _form = $('form_member_lv');
	var btn =$('member_lv-form-submit');
	var finder = finderGroup['<{$env.get._finder.finder_id}>'];

	_form.store('target',{
		onSuccess:function(response){
			var hash_res_obj = JSON.decode(response);

			if (hash_res_obj.success != undefined && hash_res_obj.success != "")
			{
				try{
					var _dialogIns = btn.getParent('.dialog').retrieve('instance');
				}catch(e){}

				if(_dialogIns)
				{
					_dialogIns.close();
					window.finderGroup['<{$env.get._finder.finder_id}>'].refresh();
				}
			}

		}
	});

	    btn.addEvent('click',function(){
		    _form.fireEvent('submit',{stop:$empty});
		});

})();

function check(obj){
	var gc_confirm_num = obj.get('value');
	var quantity = obj.get('q_data');
	if(isNaN(gc_confirm_num)){
		obj.set('value',quantity);
	}
	if(gc_confirm_num<0){
		obj.set('value',quantity);
	}
	if(gc_confirm_num>quantity){
		obj.set('value',quantity);
	}
}
</script>

<{/if}>
